<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html>
<html>
	<head>
		<jsp:include page="title.jsp"></jsp:include>
		<link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico" media="screen" />
		<script type="text/javascript" src="js/roleManager.js"></script>
		<style>
.nonode {
	list-style-type: none;
}

.rolelist {
	float: left;
}

.marr {
	margin-left: 10px;
}

.licss {
	width: 90%;
	padding-left: 10px;
}
ul{
	float:none !important;
}
ul li a{
	color:rgb(0,102,204);
}
ul li a:hover{
	color:#000;
	text-decoration:underline;
	outline:none;
}
</style>
	</head>
	<body onload="roleLoad();">
		<jsp:include page="head.jsp"></jsp:include>
		<div class="zhuti">
			<div class="jingediv"></div>
			<div class="lefterdiv">
				<jsp:include page="menu.jsp"></jsp:include>
			</div>
			<div class="jingediv"></div>
			<div class="righterdiv" id="right">
				<div class="sitebar">
						<div class="floatleft div25"></div>
						<div class="sitename font14 top26">
							&nbsp;
						</div>
						<div class="date font14 top26">
							<script type="text/javascript">
								var date=new Date();
								document.write(date.getFullYear()+"-"+(date.getMonth()+1)+"-"+date.getDate());
								if(date.getHours()<12){
									document.write("上午");
								}else
								{
									document.write("下午");
								}
							</script>
						</div>
				</div>
				<div class="widthall">
					<div class="title">
						<div class="floatleft div25"></div>
						<div class="titlename bold font24 top26">
							角色管理
						</div>
					</div>
					<div class="widthall font16 rolemntheight">
						<div class="floatleft rolemntright heigthall whitediv">
							<div class="floatleft heigthall rolelistjg"></div>
							<div class="floatleft heigthall rolelistmain">
								<div class="em30 widthall"></div>
								<div class="em20 widthall font20">
									角色列表
								</div>
								<div class="em20 widthall"></div>
								<div class="em500 widthall autoflow lineh25">
									${roleTreeHtml}
								</div>
								<div class="em20 widthall"></div>
								<div class="em50 widthall">
									<div class="floatright heigthall lineh50" style="width:18em">
										<c:if test="${language.add!=''}">
											<input type="button" class="btn" value="新增"  onclick="javascript:window.location.href='roleManagerAdd';"/>
										</c:if>
										<c:if test="${roleInfo.roleId ne roleInfo.userRoleId}">
										<c:if test="${roleHtml!=null}">
										<c:if test="${language.modify!=''}">
											<input type="button" class="btn" value="修改" onclick="roleManagerEdit();"/>
										</c:if>
										<c:if test="${language.delete!=''}">
											<input type="button" class="btn" value="删除" onclick="deleteRole();"/>
										</c:if>
										</c:if>
										</c:if>
									</div>
									<div class="cleardiv"></div>
								</div>
								<div class="em30 widthall"></div>
							</div>
							<div class="floatleft heigthall rolelistjg"></div>
						</div>
						<div class="floatleft rolemntjg heigthall">
						</div>
						<div class="floatleft rolemntleft heigthall whitediv">
							<div class="floatleft heigthall" style="width:2.4%"></div>
							<div class="floatleft heigthall" style="width:95.2%">
								<div class="widthall em30"></div>
								<div class="widthall em20 font20">
									角色权限
								</div>
								<div class="widthall em20"></div>
								<div class="widthall em500 lineh25 autoflow">
									<form action="roleManager" method="post" id="myForm">
										<input type="hidden" name="roleInfo.roleId" id="roleId" value="${roleInfo.roleId}">
										<input type="hidden" name="roleInfo.buttonString" id="buttonString" />
										<input type="hidden" value="${divString}" id="divString">
										<table id="tball" style="width: 100%; overflow: hidden;">
											<tr>
												<td id="tdall" style="width: 100%; vertical-align: top;">
													<div id="Acc1">
														<c:if test="${roleHtml!=null}">
														<c:forEach items="${oneList}" var="menuInfo">
															<div id="${menuInfo.menuId}" onclick="divClick(this.id)" class="accordionHeader">
																<table border="0" cellpadding="2" cellspacing="1"
																	width="100%" class="gridView">
																	<tr>
																		<td class="gridHead">
																			${menuInfo.sortId}.${menuInfo.menuNameNote}
																		</td>
																	</tr>
																</table>
															</div>
															<div id="AccpContain${menuInfo.menuId}"
																class="accordionContent" style="display: block;">
																<table border="0" cellspacing="1" width="100%">
																	<tr align="right">
																		<td width="100%" style="color: #333;">
																			<input id="AccpContain${menuInfo.sortId}_cb${menuInfo.sortId}" type="checkbox"
																				name="AccpContain${menuInfo.sortId}$cb${menuInfo.sortId}" onclick="systemcheck(${menuInfo.sortId});" />
																			<label for="AccpContain{menuInfo.sortId}_cb${menuInfo.sortId}">
																				全选
																			</label>
																		</td>
																	</tr>
																	<tr style="background-color: white; padding-right: 2;">
																		<td width="100%" style="color: #000;">
																			<table id="AccpContain${menuInfo.sortId}_tb${menuInfo.sortId}" width="100%"
																				class="gridView" border="0" cellspacing="0">
																				<c:forEach items="${twoList}" var="meInfo">
																					<c:if
																						test="${meInfo.parentId eq menuInfo.menuId}">
																						<tr class="gridRow">
																							<td style="width:1.5%"></td>
																							<td style="width:18.5%">
																								${meInfo.menuNameNote}
																							</td>
																							<td style="width:71.8%">
																								<div class="widthall lineh25">
																									
																										<c:forEach items="${roleHtml}"
																											var="pageButton">
																											<div class="floatleft" style="width:20%">
																											<c:if
																												test="${pageButton.menuId eq meInfo.menuId}">
																												<c:choose>
																												<c:when
																													test="${pageButton.isChecked=='Y'}">
																													<c:choose>
																														<c:when test="${pageButton.operationId=='1'}">
																															
																														<input name="AccpContain${menuInfo.sortId}$${meInfo.menuId}-${pageButton.operationId}"
																															type="checkbox"
																															id="AccpContain${menuInfo.sortId}_${meInfo.menuId}-${pageButton.operationId}"
																															onclick="aaa(this)"
																															checked="checked" />
																													
																														</c:when>
																														<c:otherwise>
																															
																														<input name="AccpContain${menuInfo.sortId}$${meInfo.menuId}-${pageButton.operationId}"
																															type="checkbox"
																															id="AccpContain${menuInfo.sortId}_${meInfo.menuId}-${pageButton.operationId}"
																															onclick="aa(${menuInfo.sortId},${meInfo.menuId},${pageButton.operationId})"
																															checked="checked" />
																													
																														</c:otherwise>
																													</c:choose>
																												</c:when>
																												<c:otherwise>
																													<c:choose>
																														<c:when test="${pageButton.operationId=='1'}">
																															
																														<input name="AccpContain${menuInfo.sortId}$${meInfo.menuId}-${pageButton.operationId}"
																															type="checkbox"
																															id="AccpContain${menuInfo.sortId}_${meInfo.menuId}-${pageButton.operationId}"
																															onclick="aaa(this)"/>
																													
																														</c:when>
																														<c:otherwise>
																															
																														<input name="AccpContain${menuInfo.sortId}$${meInfo.menuId}-${pageButton.operationId}"
																															type="checkbox"
																															id="AccpContain${menuInfo.sortId}_${meInfo.menuId}-${pageButton.operationId}"
																															onclick="aa(${menuInfo.sortId},${meInfo.menuId},${pageButton.operationId})"/>
																													
																														</c:otherwise>
																													</c:choose>
																												</c:otherwise>
																												</c:choose>
																													${pageButton.operationName}
																											</c:if>
																											</div>
																										</c:forEach>
																									</div>
																							</td>
																							<td style="width:8.2%"></td>
																						</tr>
																					</c:if>
																				</c:forEach>
																			</table>
																		</td>
																	</tr>
																</table>
															</div>
														</c:forEach>
														</c:if>
													</div>
												<td></td>
											</tr>
										</table>
									</form>
								</div>
								<div class="widthall em20"></div>
								<div class="widthall em50">
									<div class="heigthall floatright lineh50" style="width:12em">
										<c:if test="${roleInfo.roleId ne roleInfo.userRoleId}">
										<c:if test="${roleHtml!=null}">
										<c:if test="${language.modify!=''}">
											<input type="button" class="btn" value="保存" onclick="saveConfig(tball);"/>
										</c:if>
										</c:if>
										</c:if>
									</div>
								</div>
								<div class="widthall em30"></div>
							</div>
							<div class="floatleft heigthall" style="width:2.4%"></div>
						</div>
					</div>
				</div>
			</div>
			<div class="cleardiv">
			</div>
		</div>
		<input type="hidden" value="${message}" id="message" name="message">
		<jsp:include page="footer.jsp"></jsp:include>
	</body>
</html>
